home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Leonardo the Inventor
/
Leonardo The Inventor (93026)(Broderbund)(Riverdeep)(2004).iso
/
LEOWINMV
/
SHARED.DIR
/
03077_Script_GO HANDLERS LEONARDO I & II
< prev
next >
Wrap
Text File
|
1996-04-01
|
14KB
|
532 lines
-- -----------------------------------------------------------
-- Handler goInventions goes to the inventions screen if the
-- inventions animation has already been viewed and to the
-- inventions animation otherwise.
on goInventions
global inventionsAnimationViewed
-- waitCursor
-- stopVoice
playLoadingSound
if voidP(inventionsAnimationViewed) then
set inventionsFrame = "mark1"
set inventionsAnimationViewed = TRUE
else
set inventionsFrame = "mark2"
end if
stopVoice
go frame inventionsFrame of movie the pathName & "InveAnim.dir"
normalCursor
end
-- -----------------------------------------------------------
-- Handler goInvention goes to the movie of the given invention.
on goInvention which
global currentInvention
waitCursor
stopVoice
playLoadingSound
set currentInvention = which
put getInventionMovieName (which) into InventionMovieName
if (InventionMovieName = empty) then
go frame which of movie the pathName & "Leonardo"
else
go movie the pathName & InventionMovieName
end if
normalCursor
end
-- -----------------------------------------------------------
-- Handler goIntroduction goes to the introduction movie.
on goIntroduction
waitCursor
playLoadingSound
go frame "BeginIntro" of movie the pathName & "Intro"
normalCursor
end
-- -----------------------------------------------------------
-- Handler goBiography goes to the biography movie.
on goBiography
waitCursor
playLoadingSound
go movie the pathName & "BIO"
normalCursor
end
-- -----------------------------------------------------------
-- Handler goTimeline goes to the timeline.
on goTimeLine
waitCursor
playLoadingSound
go movie the pathName&"Timeline"
normalCursor
end
-- -----------------------------------------------------------
-- Handler doTimeline goes to the index.
on doTimeline
put "*** called doTimeLine from frame" && the frame && "of movie" && the movie
goIndex -- For historical reasons, this handler has this name.
-- To eliminate it, must change doTimeLine in every movie to goIndex
end
-- -----------------------------------------------------------
-- Handler goWorks goes to the works movie.
on goWorks
waitCursor
playLoadingSound
go movie the pathName & "Works"
normalCursor
end
-- -----------------------------------------------------------
-- Handler goBibliography goes to the bibliography.
on goBibliography
waitCursor
playLoadingSound
go movie the pathName & "Biblio"
normalCursor
end
-- -----------------------------------------------------------
-- Handler goMonalisa goes to the MomaLiza old movie
on goMonalisa
waitCursor
playLoadingSound
go movie the pathName & "MonaLisa"
normalCursor
end
-- -----------------------------------------------------------
-- Handler doQuit goes to the credits movie.
on doQuit
playLoadingSound
go movie the pathName&"Credits"
end
-- -----------------------------------------------------------
-- Handler goMain goes to the main movie (frame "contents" of
-- movie "Leonardo.dir")
on goMain
waitCursor
stopVoice
playLoadingSound
if (the movie = "Leonardo.DIR") then
unhiliteButton
go frame "Contents"
else
go frame "Contents" of movie the pathName & "Leonardo.DIR"
end if
normalCursor
end
-- -----------------------------------------------------------
-- Handler goTour goes to
-- movie "Tour.dir")
on goTour
waitCursor
--stopVoice
--sound stop 1
go movie the pathName & "tour.DIR"
normalCursor
end
-- -----------------------------------------------------------
-- Handler rememberLocation
on rememberLocation
global indexReturn, currentInvention
set indexReturn = ""
if (char 1 to 2 of the movie = "I_") then
set indexReturn = "frame" && quote & currentInvention && "menu" & quote && "of movie" && quote & getInventionMovieName (currentInvention) & quote
else if (the movie = "Leonardo.DIR") then
repeat with i = 0 to 1
end repeat
else if (char 1 to 3 of the movie = "ML_") then
set indexReturn = "frame" && quote & getCategoryFromMonaLisaMovieName (the movie) && "menu noSound" & quote && "of movie" && quote & the movie & quote
else
set indexReturn = "movie" && quote & the movie & quote
end if
end
-- -----------------------------------------------------------
-- Handler goIndex stores the current location and goes to the
-- index movie.
on goIndex
rememberLocation
playLoadingSound
go movie the pathName & "INDEX"
end
-- -----------------------------------------------------------
-- Handler goDatabase goes to the database movie.
on goDatabase
playLoadingSound
go movie the pathName & "database.dir"
end
-- -----------------------------------------------------------
-- Handler goHelp goes to the help movie.
on goHelp
global fromHelpMovie, fromHelpFrame
playLoadingSound
set fromHelpMovie = the movieName
set fromHelpFrame = the frame
go movie the pathName & "HELP"
end
-- -----------------------------------------------------------
-- Handler returnFromHelp returns to the location before the
-- help movie was opened.
on returnFromHelp
global fromHelpMovie, fromHelpFrame
playLoadingSound
if fromHelpMovie = "database.dir" then
set fromHelpFrame = 1
end if
go frame fromHelpFrame of movie fromHelpMovie
end
-- -----------------------------------------------------------
-- Handler goInventionsWithSound ???
--
--on goInventionsWithSound
-- global alreadyViewedInventionsWSound
--
-- waitCursor
--
-- if (alreadyViewedInventionsWSound = empty) then
-- set alreadyViewedInventionsWSound = false
-- end if
--
-- if alreadyViewedInventionsWSound then
-- goInventions
-- exit
-- end if
--
-- set alreadyViewedInventionsWSound = true
--
-- if (the movie = "Leonardo.DIR") then
-- go frame "Inventions Menu"
-- else
-- go frame "Inventions Menu" of movie the pathName&"Leonardo.DIR"
-- end if
-- normalCursor
--end
--
-- -----------------------------------------------------------
-- Handler goInventions ???
--
--on goInventions
-- waitCursor
-- stopVoice
-- playLoadingSound
--
-- if (the movie = "Leonardo.DIR") then
-- go frame "Inventions Menu noSound"
-- else
-- go frame "Inventions Menu noSound" of movie the pathName & "Leonardo.DIR"
-- end if
--
-- normalCursor
--end
--
-- -----------------------------------------------------------
-- Handler goBack goes to the main.
on goBack
-- Go up in heirarchy...
-- For now, just goes to contents, because other "Menu" sprites
-- have their own command.
goMain
end
-- -----------------------------------------------------------
-- Handler goWordsToMenu goes from the words section of an
-- invention to the invention's menu (located at the previous
-- marker.)
on goWordsToMenu
unhiliteButton
go marker (-1)
unfreezeDigitalVideo
end
-- -----------------------------------------------------------
-- Handler goTimeToMenu goes from the time section of an
-- invention to the invention's menu (located at 2 markers
-- earlier.)
on goTimeToMenu
unhiliteButton
go marker (-2)
unfreezeDigitalVideo
end
-- -----------------------------------------------------------
-- Handler goGameToMenu goes from the time section of an
-- invention to the invention's menu (located at 3 markers
-- earlier.)
on goGameToMenu
unhiliteButton
go marker (-3)
unfreezeDigitalVideo
end
-- -----------------------------------------------------------
-- Handler goMenu goes to the menu of the invention stored in
-- the global variable currentInvention.
on goMenu
global currentInvention
if not(stringp(currentInvention)) then set currentInvention = ""
unhiliteButton
set inventionMovie = getInventionMovieName (currentInvention)
if (the movie = inventionMovie) then
go frame currentInvention && "menu"
else
go frame currentInvention && "menu" of movie inventionMovie
end if
end
-- -----------------------------------------------------------
-- Handler goWords goes from the invention's menu to the word
-- section of the invention (1 marker later)
on goWords
freezeDigitalVideo
unhiliteButton
transitionToWords
go marker (1)
end
-- -----------------------------------------------------------
-- Handler goTime goes from the invention's menu to the time
-- section of the invention (2 markers later)
on goTime
global MPEGVersion, currentInvention
if MPEGVersion and existsMPEGForInvention(currentInvention) then
goMPegTime
else
freezeDigitalVideo
unhiliteButton
transitionToTime
sound stop 2
go marker (2)
end if
end
-- -----------------------------------------------------------
-- Handler goGame goes from the invention's menu to the game
-- section of the invention (3 markers later)
on goGame
freezeDigitalVideo
unhiliteButton
transitionToGame
go marker (3)
end
-- -----------------------------------------------------------
-- Handler goCategory goes to the menu of the given category
-- if the option key was pressed and to the beginning of the
-- category otherwise.
on goCategory which
hiliteButtonKeepHilited(1,1)
set skipIntro = the optionDown
waitCursor
playSpecificLoadingSound
if skipIntro then
goCategoryMenu which
else
goCategoryIntro which
end if
normalCursor
end
-- -----------------------------------------------------------
-- Handler goCategoryIntro goes to the next animation of the
-- given category (called by goCategory).
on goCategoryIntro which
waitCursor
set animationNumber = getAnimationNumber(which)
set animationFrame = which & animationNumber
go frame animationFrame of movie (the pathName & "ML_" & char 1 to 5 of which)
normalCursor
end
-- -----------------------------------------------------------
-- Handler getAnimationNumber returns the number of the next
-- animation for the given category.
on getAnimationNumber category
set categoryAnimationData = field "categoryAnimationData"
set theLine = BinSearchFirstItemInLine(categoryAnimationData, category, ",")
if (theLine = 0) then
alert category && "not found in categoryAnimationData"
exit
end if
set lineData = line theLine of categoryAnimationData
set numAnimations = value(item 2 of lineData)
set lastAnimation = value(item 3 of lineData)
set currentAnimation = lastAnimation + 1
if (currentAnimation > numAnimations) then
set currentAnimation = 1
end if
put currentAnimation into item 3 of line theLine of field "categoryAnimationData"
return currentAnimation
end
-- -----------------------------------------------------------
-- Handler getCategoryNarrationFlag returns 1 if the user already
-- heard the narration for the intro of the given category and 0
-- otherwise.
on getCategoryNarrationFlag category
set categoryAnimationData = field "categoryAnimationData"
set theLine = BinSearchFirstItemInLine(categoryAnimationData, category, ",")
if (theLine = 0) then
alert category && "not found in categoryAnimationData"
exit
end if
set lineData = line theLine of categoryAnimationData
set narrationFlag = value(item 4 of lineData)
if (narrationFlag = 0) then
put string(1) into item 4 of line theLine of field "categoryAnimationData"
end if
return narrationFlag
end
-- -----------------------------------------------------------
-- Handler resetCategoryNarrationFlags is called from initializeLeonardo2.
-- It resets the flags of the category narrations to 0 (meaning they
-- have not been heard yet).
on resetCategoryNarrationFlags
set numCategories = the number of lines in field "categoryAnimationData"
repeat with i = 1 to numCategories
put string(0) into item 4 of line i of field "categoryAnimationData"
end repeat
end
-- -----------------------------------------------------------
-- Handler goCategoryMenu goes to the menu of the given category
-- (called by goCategory).
on goCategoryMenu which
waitCursor
set narrationFlag = getCategoryNarrationFlag(which)
if narrationFlag then
set menuFrame = which && "menu noSound"
else
set menuFrame = which && "menu"
end if
if (the movie = ("ML_" & (char 1 to 5 of which) & ".DIR")) then
-- already in the right movie, just go to the right frame
-- unhiliteButton
dissolve 3
go frame menuFrame
else
-- go to the right frame of the right movie
go frame menuFrame of movie (the pathName & "ML_" & (char 1 to 5 of which) &".DIR")
end if
normalCursor
end
-- -----------------------------------------------------------
-- Handler returnToCategoryMenu goes to the menu of the given
-- category
on returnToCategoryMenu which
waitCursor
stopVoice
playLoadingSound
go frame which && "menu noSound" of movie (the pathName&"ML_" & char 1 to 5 of which)
normalCursor
end
-- ----------------------------------------------------------------
-- Handler goMoreInvention
on goMoreInvention inventionMarker
go frame inventionMarker
end
-- ----------------------------------------------------------------
-- Handler returnMoreInventionsMenu
on returnMoreInventionsMenu
go frame "MInventStart"
end
-- ----------------------------------------------------------------
-- Handler replay
on replay replayMarker, replayMovie
clearDigitalVideo
if voidP(replayMovie) or (the movieName = replayMovie) then
go frame replayMarker
else
go frame replayMarker of movie replayMovie
end if
end mouseDown
on existsMPEGForInvention whichInvention
return getPos(["BridgeCanal", "diving", "dredger", "helicopter", "landinggear", "paddleboat", "Snorkel", "tank", "walls", "Wing", "Woodwind"] whichInvention)
end